package com.woniuxy.microsysserver.controller;

import com.alibaba.fastjson.JSONObject;
import com.woniuxy.bean.ResultBean;
import com.woniuxy.microsysserver.entity.NavigationEntity;
import com.woniuxy.microsysserver.service.NavigationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * Auther: wuson  <br/>
 * Date: 2021/4/12:15:18  <br/>
 * Description:
 */
@RefreshScope
@Api("导航")
@Slf4j
@RequestMapping("/sys/navigation")
@RestController
public class NavigationController {
    @Autowired
    private NavigationService navigationService;
    @ApiOperation("导航信息")
    @GetMapping(value = "/info", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResultBean getInfo(){
        List<NavigationEntity> navigations = navigationService.selectAll();
        return ResultBean.builder().code(200).data(navigations).build();
    }

}
